﻿function ShowHistoricalView(postId, currentDocumentId)
{
  //var post = document.getElementById("PostView_" + postId);
  document.getElementById("MemberView_" + postId).style.display = "none";
  document.getElementById("HistoricalView_" + postId).style.display = "block";

  ShowHistoricalVersion(postId, currentDocumentId);
}

function ShowHistoricalVersion(postId, documentId)
{
  var items = document.getElementById("HistoricalView_" + postId).getElementsByTagName("div");
  for (var i = 0; i < items.length; i++)
    items[i].style.backgroundColor = "#AAAAAA";

  document.getElementById("VersionIndexItem_" + documentId).style.backgroundColor = "#EEEEEE";

  var items = document.getElementById("DocumentView_" + postId).getElementsByTagName("table");
  for (var i = 0; i < items.length; i++)
    items[i].style.display = "none";

  document.getElementById("VersionView_" + documentId).style.display = "block";

}

function ExitHistoricalView(postId, currentDocumentId)
{
  ShowHistoricalVersion(postId, currentDocumentId);

  document.getElementById("MemberView_" + postId).style.display = "block";
  document.getElementById("HistoricalView_" + postId).style.display = "none";
}